package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.BankCardActivity;
import flc.ast.activity.BusinessLicenseRecActivity;
import flc.ast.activity.IdCardRecActivity;
import flc.ast.activity.RecCameraActivity;
import flc.ast.databinding.FragmentHomeBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link HomeFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class HomeFragment extends BaseNoModelFragment<FragmentHomeBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_home;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.ivPlantRec.setOnClickListener(this);
        mDataBinding.ivAnimalRec.setOnClickListener(this);
        mDataBinding.ivIdCardRec.setOnClickListener(this);
        mDataBinding.ivBankCardRec.setOnClickListener(this);
        mDataBinding.ivBusinessLicenseRec.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivPlantRec://植物识别
                RecCameraActivity.type = 0;
                startActivity(RecCameraActivity.class);
                break;
            case R.id.ivAnimalRec://动物识别
                RecCameraActivity.type = 1;
                startActivity(RecCameraActivity.class);
                break;
            case R.id.ivIdCardRec://身份证识别
                startActivity(IdCardRecActivity.class);
                break;
            case R.id.ivBankCardRec://银行卡识别
                startActivity(BankCardActivity.class);
                break;
            case R.id.ivBusinessLicenseRec://营业执照识别
                startActivity(BusinessLicenseRecActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}